package com.jintian.smart.kernel.security.mapper;

import com.jintian.smart.base.api.security.entity.PasswordLogEntity;
import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;

import java.util.List;

@Mapper
@SqlResource("security.PasswordLog")
public interface PasswordLogMapper extends IBaseExtMapper<PasswordLogEntity> {
    /**
     * 查询最后一次修改密码记录
     *
     * @param userType
     * @param userId
     * @return
     */
    PasswordLogEntity selectLastByUserTypeAndUserId(@Param("userType") Integer userType, @Param("userId") Long userId);

    /**
     * 查询最近几次修改后的密码
     *
     * @param userType
     * @param userId
     * @return
     */
    List<String> selectOldPassword(@Param("userType") Integer userType, @Param("userId") Long userId, @Param("limit") int limit);
}
